package org.example.game.weekly.game411;

import java.util.Arrays;

/**
 * @Description: TODO
 * @Author wyatt
 * @Data 2024/08/03 20:46
 */
public class Solution002 {


    public int maxPossibleScore(int[] start, int d) {
        Arrays.sort(start);
        int min = start[0];
        int max = start[start.length-1];
        int mind = Integer.MAX_VALUE;
        for (int i = 0; i < start.length-1; i++) {
            mind = Math.min(start[i+1] - start[i] + d, mind);
        }
        return Math.min(mind, (max-min+d)/(start.length-1));
    }

}
